home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer: Getting Started / Internet Surfer - Getting Started (Wayzata Technology)(7231)(1995).bin / pc / mac / bonus / peter_le / finger_1 / tokens / testbed.p < prev    next >
Text File  |  1991-12-17  |  1KB  |  48 lines

  1. program TestBed;
  2.  
  3.     uses
  4.         ParameterDef, Lookup;
  5.  
  6.     var
  7.         p: parameterRecord;
  8.         i: longInt;
  9.         ch: char;
  10.         sysenv: sysEnvRec;
  11.         oe: OSErr;
  12. begin
  13.     p.fingeredname := stringPtr(newPtr(256));
  14.     p.param := stringPtr(newPtr(256));
  15.     p.returnvalue := stringPtr(newPtr(256));
  16.     p.returnValue^ := '';
  17.     p.hlength := 5000;
  18.     p.fingeroutput := NewHandle(p.hlength);
  19.     p.offset := 0;
  20.     p.idle := 73; { 1 min, 13 sec }
  21.     p.remoteIP := $12345678;  {18.52.86.120}
  22.     p.expandtokens := true;
  23.     oe := SysEnvirons(1, sysenv);
  24.     oe := SetVol(nil, sysenv.SysVRefNum);
  25.  
  26.     p.fingeredname^ := 'sch';
  27.     p.param^ := '';
  28.  
  29.     ShowText;
  30.     writeln('Call with parameter "', p.param^, '", and name "', p.fingeredname^, '"');
  31.     Main(p);
  32.     if p.returnValue^ <> '' then
  33.         writeln('Gives string: "', p.returnValue^, '"');
  34.     if p.offset <> 0 then begin
  35.         writeln('Gives expandtokesns: ', p.expandtokens);
  36.         writeln('Gives handle:');
  37.         HLock(p.fingeroutput);
  38.         write('"');
  39.         for i := 0 to p.offset - 1 do begin
  40.             ch := chr(BAND(ptr(longInt(p.fingeroutput^) + i)^, $FF));
  41.             if ch = chr(13) then
  42.                 writeln
  43.             else
  44.                 write(ch);
  45.         end;
  46.         writeln('"');
  47.     end;
  48. end.